package com.wxc.config.shiro;

import com.wxc.service.RedisService;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.cache.CacheManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author wxc
 * @date 2021年10月24日 22:02
 */
@Component
public class CustomCacheManager implements CacheManager {

    @Autowired
    private RedisService redisService;

    @Autowired
    private RedisCache redisCache;

    @Override
    public <K, V> Cache<K, V> getCache(String s) throws CacheException {
        return (Cache<K, V>) redisCache;
    }
}
